/*
    Project:        Home Power Control
    File:           HPCLight.h
    Author:         christian@karunamusic.at
    Date:           02.2015
    Description:    Sensor to measure the ambient light with the TSL45315.
 */

#ifndef HPCLIGHT_H
#define HPCLIGHT_H

#include <QString>
#include <HPCSensor.h>

class HPCLight : public HPCSensor
{
    Q_OBJECT
public:
    /** \brief Constructor
     *
     * \param name name of the sensor.
     * \param id database id of the sensor.
     * \param i2caddr the address on the i2c-bus.
     */
    explicit HPCLight( const QString& name, quint32 id, quint8 i2caddr );
    /** \brief Destructor.
     */
    virtual ~HPCLight();

    /** \brief Get class with content as printable string.
     *
     * \return string
     */
    QString asString() const;

protected:
    /** \brief Get a value from the sensor.
     */
    virtual void Measure();

private:
    int m_I2C; /**< filehandle for i2c-device */
};

#endif // HPCLIGHT_H
